The present invention relates to the field of information technology and, in particular, to a method for content responding, a method for content requesting, a content responder and a content requester.
At present, content is usually transmitted by using HTTP (Hypertext Transfer Protocol) between a content responder, such as a Web server, and a content requestor, such as a browser (e.g., IE(Internet Explorer), Firefox).
As is well known, the main characteristics of standard HTTP include:
1. support client/server mode;
2. connectionless; and
3. stateless.
Here “connectionless” means limiting each connection to process only one request. A server creates a connection when receiving a request from a client, and disconnects the connection after having processed and responded to the request of the client. In such manner, the burden of the server can be reduced.
“Stateless” means that the HTTP has no capability of memorizing transaction processing. The absence of the state implies that the previous information has to be re-transmitted if the information is needed by subsequent processing; this may result in a greater amount of data to be communicated every time.
FIG. 1 illustrates a process of transmitting contents between a client (content requester) 102 such as IE, and a server (content responder) 104 such as Apache web server according to the HTTP protocol in the prior art.
It shall be understood that a network (not shown) may be included between the client 102 and the server 104. The network can be a wireless network, a wired network, or the combination thereof. In addition, the network can be a local area network, a metropolitan area network, a wide area network, or the combination thereof. The client 102 and the server 104 are connected to the network via a link, respectively. The link can be a wired link or a wireless link, such as a coaxial cable, optical fiber, or satellite link, etc.
First, in step 110, a connection (TCP/IP connection) is established between the client 102 and the server 104.
Then, in step 112, the client 102 transmits a first request to the sever 104 to thereby obtain a first content from the server 104.
The following codes show an example of the request header:
Request Header:
GET /shapes/index.html HTTP/1.0
Accept: text/*
Accept: text/plain
Accept: text/html
Referer: http://9.24.104.247:8888/shapes/index.html
User-Agent: Charlotte/1.2.1 VM_ESA/1.2.2 CMS/11 via proxy gateway CERN-HTTPD/3.0 libwww/2.17
After receiving the first request, the server 104 processes the first request to generate the first content required by the first request. Furthermore, after finishing the processing of the first request, a first response is transmitted to the client 102 to thereby transmit to the client 102 the first content required by the first request, as shown in step 114. The aforesaid first content is included in the response and transmitted to the client 102 in the form of the descriptive language such as HTML (Hypertext Markup Language) and XML (Extensible Markup Language).
The following codes show an example of the response header:
Response Header:
HTTP/1.0 200 Document follows
Server: IBM-Secure-Export-ICS/4.1Beta4
Date: Thursday, 06-Jun-96 21:22:16 GMT
Content-Type: text/html
Content-Length: 457
Last-Modified: Friday, 24-May-96 15:44:07 GMT
<HTML>
. . .
</HTML>
Then, in step 116, the connection (TCP/IP connection) between the client 102 and the server 104 is closed.
When the client 102 needs to acquire content from the server 104 again, a connection (TCP/IP connection) is established once again between the client 102 and the server 104, as shown in step 118.
After that, in step 120, the client 120 transmits a second request to the server 104 to thereby obtain a second content from the server 104.
After receiving the second request, the server 104 processes the second request to generate the second content required by the second request. Furthermore, after finishing the processing of the second request, a second response is transmitted to the client 102 to thereby transmit to the client 102 the second content required by the second request, as shown in step 122. The aforesaid second content is included in the second response and is transmitted to the client 102 in the form of the descriptive language such as HTML and XML.
Then, in step 124, the connection (TCP/IP connection) between the client 102 and the server 104 is closed once again.
In the prior art, due to the aforesaid stateless characteristic of the HTTP, i.e. the HTTP having no capability of memorizing transaction processing, even if the aforesaid first content and second content are quite similar (for example, only several words or background colors are different, which often happens in some applications such as online bank servicing, online shopping operating, etc.), it also needs to transmit the second content completely. In other words, if the first content contains 100k bytes data, and there is only a difference of 100 bytes of data between the second content and the first content (i.e., the second content also includes about 100k bytes data), then in the prior art, it needs to transmit about 200k bytes data (the first content and the second content). Since the network bandwidth is limited in many cases, the repetitive transmission of the same content results in occupation of the limited bandwidth and increased network transmission time and client waiting time.